<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>添加</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/admin/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/admin/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="/admin/css/animate.min.css" rel="stylesheet">
    <link href="/admin/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="/admin/frame/layer/css/layui.css" rel="stylesheet">

</head>
<body>
<div class="container-fluid" style="margin-top: 30px;">
    <div class="row">
        <div class="col-sm-12 col-md-12">
            <form class="form-horizontal" id="addForm" action="/Admin/Device/DeviceInfo/saveOrUpdate">
                <div class="form-group col-sm-6">
                    <label class="col-sm-4 control-label"><span style="color: red">*</span>编号：</label>
                    <div class="col-sm-8">
                        <input type="text" readonly value="${deviceInfo.id}" name="id" class="form-control" placeholder="请输入车辆名称">
                    </div>
                </div>
                <div class="form-group col-sm-6">
                    <label class="col-sm-4 control-label"><span style="color: red">*</span>车辆名称：</label>
                    <div class="col-sm-8">
                        <input type="text" value="${deviceInfo.deviceName}" name="deviceName" class="form-control" placeholder="请输入车辆名称">
                    </div>
                </div>
                <div class="form-group col-sm-6">
                    <label class="col-sm-4 control-label"><span style="color: red">*</span>设备编号：</label>
                    <div class="col-sm-8">
                        <input minlength="16" value="${deviceInfo.deviceDid}" maxlength="16" type="text" name="deviceDid" class="form-control" placeholder="请输入设备编号">
                    </div>
                </div>
                <div class="form-group col-sm-6">
                    <label class="col-sm-4 control-label"><span style="color: red">*</span>价格/时：</label>
                    <div class="col-sm-8">
                        <input type="number" value="${deviceInfo.devicePrice}" name="devicePrice" class="form-control" placeholder="请输入每小时价格">
                    </div>
                </div>
                <div class="form-group col-sm-6">
                    <label class="col-sm-4 control-label"><span style="color: red">*</span>设备类型：</label>
                    <div class="col-sm-8">
                        <select class="form-control" name="deviceTypeName">
                            <c:if test="${deviceInfo.deviceTypeName == '自行车'}">
                                <option value="自行车" selected>自行车</option>
                                <option value="电动车">电动车</option>
                            </c:if>
                            <c:if test="${deviceInfo.deviceTypeName == '电动车'}">
                                <option value="自行车" >自行车</option>
                                <option value="电动车" selected>电动车</option>
                            </c:if>
                        </select>
                    </div>
                </div>
                <div class="form-group col-sm-12">
                    <label class="col-sm-2 control-label"><span style="color: red">*</span>当前位置：</label>
                    <div class="col-sm-9">
                        <input id="address" type="text" class="form-control" readonly placeholder="">
                    </div>
                </div>
                <div class="form-group col-sm-12">
                    <div class="col-sm-9 col-sm-offset-2">
                        <div class="form-control" id="container" style="height: 200px;">

                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

</body>
<script src="/admin/frame/jquery/jquery-1.9.1.min.js"></script>
<script src="/admin/frame/bootstrap/js/bootstrap.min.js"></script>
<script src="/admin/js/content.min.js?v=1.0.0"></script>
<script src="/admin/frame/jquery-validate/jquery.validate.min.js"></script>
<script src="/admin/frame/jquery-validate/messages_zh.min.js"></script>
<script charset="utf-8" src="http://map.qq.com/api/js?v=2.exp"></script>
<script>
    $().ready(function() {
        $("#addForm").validate();
    });
    $(function(){
        var lnglat= new qq.maps.LatLng(${deviceInfo.deviceLat},${deviceInfo.deviceLng});
        var map = new qq.maps.Map(document.getElementById("container"), {
            // 地图的中心地理坐标。
            center:lnglat,
            zoom: 18,//缩放级别
            mapTypeControl: false,
            zoomControl: false,
        });
        var  marker = new qq.maps.Marker({
            position: lnglat,
            draggable: true,
            map: map
        });
        geocoder = new qq.maps.Geocoder({
            complete:function(result){
               $("#address").val(result.detail.address);
            }
        });
        geocoder.getAddress(lnglat);
    })
</script>
</html>
